package demo2;

interface IShape {
    //成员:默认是public static final修饰的
    //public static final int age = 12;
    //int age2 = 100;
    //接口当中的抽象方法默认都是public abstract
    public abstract void draw();
    //void draw2();
    //default修饰的方法可以重写也可不重写
    default public void draw3() {
        System.out.println("111");
    }
    //static修饰的方法不能被重写
    public static void draw4() {
        System.out.println("2222");
    }
}
class Cycle implements IShape {
    @Override
    public void draw() {
        System.out.println("⭕");
    }
}
class Rect implements IShape {
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}
public class Test {
    public static void drawMap(IShape iShape) {
        iShape.draw();
    }
    public static void main(String[] args) {
        IShape iShape = new Cycle(); //向上转型
        iShape.draw();
        //drawMap(new Cycle());
        //drawMap(new Rect());
        //接口不能实例化
        //IShape iShape = new IShape();
    }
}
